package com.kaifamiao.map;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 * 任意Map集合都可以获得三种不同的集合:
 * 1、键集(keys): map.keySet()
 * 2、值集(values): map.values()
 * 3、映射项集合(entries): map.entrySet()
 */
public class MapTest2 {

	public static void main(String[] args) {
		
		Map<String,Integer> map = Map.of( "鸡蛋" , 2 , "回锅肉" , 26 , "盐煎肉" , 26 , "小炒肉" , 18 );
		System.out.println( map );
		
		Set<String> keys = map.keySet();
		System.out.println( keys );
		
		Collection<Integer> values = map.values();
		System.out.println( values );
		
		Set< Map.Entry<String,Integer> > entries = map.entrySet();
		System.out.println( entries );
		

	}

}
